import http from '@/request/http_81';
import config from '@/config';

export async function createOrder(body) {
    let { data: res } = await http.post(`${config.server_projectName}-order/order/create`, body);
    return res;
}

export async function reFlushOrder(orderId) {
    let { data: res } = await http.get(`${config.server_projectName}-order/order/flush/qrCode/${orderId}`);
    return res;
}

export async function checkPayState(orderId) {
    let { data: res } = await http.get(`${config.server_projectName}-order/order/look/payState/${orderId}`);
    return res;
}

export async function getOrderList(type) {
    let url = `${config.server_projectName}-order/order/look/briefOrder`;
    if(type) {
        url = `${url}/${type}`;
    }
    let { data: res } = await http.post(url);
    return res;
}